﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SpaceGame
{

    public class SpaceShipFactory
    {
        public static SpaceShip CreateSpaceShip(string spaceShipClass, Position pos) 
        {
            if (spaceShipClass == "wraith")
            {
                Wraith w = new Wraith(pos);
                return w;
            }
            else if (spaceShipClass == "battlecruiser")
            {
                Battlecruiser b = new Battlecruiser(pos);
                return b;
            }
            else if (spaceShipClass == "scourge")
            {
                Scourge s = new Scourge(pos);
                return s;
            }
            else if (spaceShipClass == "guardian")
            {
                Guardian g = new Guardian(pos);
                return g;
            }
            else
            {
                throw new InvalidSpaceShipException();
            }
        }
    }
}
